//search页面小仓库
import { reqGetSearchInfo } from '@/api'
const state = {
    searchList: {}
};
const mutations = {
    REQGETLIST(state, searchList) {
        state.searchList = searchList
    }
};
const actions = {
    async getSearchList({ commit }, params) {
        let result = await reqGetSearchInfo(params)
        if (result.code == 200) {
            commit('REQGETLIST', result.data)
        }
    }
};
const getters = {
    //网络不行state.searchList.goodsList返回undefined
    goodsList(state) {
        return state.searchList.goodsList||[]
    },
    trademarkList(state) {
        return state.searchList.trademarkList
    },
    attrsList(state) {
        return state.searchList.attrsList
    }
};

export default {
    namespace:true,
    state,
    mutations,
    actions,
    getters,
}